import request from './request'

const userManageApi = {
  // 分页查询用户列表
  pageUsers: (params) => {
    return request({
      url: '/manage/user/page',
      method: 'get',
      params
    })
  },

  // 根据ID获取用户信息
  getUserById: (id) => {
    return request({
      url: `/manage/user/${id}`,
      method: 'get'
    })
  },

  // 创建用户
  createUser: (data) => {
    return request({
      url: '/manage/user',
      method: 'post',
      data
    })
  },

  // 更新用户信息
  updateUser: (id, data) => {
    return request({
      url: `/manage/user/${id}`,
      method: 'put',
      data
    })
  },

  // 删除用户
  deleteUser: (id) => {
    return request({
      url: `/manage/user/${id}`,
      method: 'delete'
    })
  },

  // 批量删除用户
  batchDeleteUsers: (ids) => {
    return request({
      url: '/manage/user/batch',
      method: 'delete',
      data: ids
    })
  },

  // 重置用户密码
  resetPassword: (id) => {
    return request({
      url: `/manage/user/${id}/reset-password`,
      method: 'post'
    })
  }
}

export default userManageApi 